#ifndef ICONTROLLERPAD_H
#define ICONTROLLERPAD_H

#include "KmyStructDef.h"

class KmyIControllerPad
{
public:
    KmyIControllerPad();
    virtual ~KmyIControllerPad();

    const static u16 KEY_UP     = 0x0001;
    const static u16 KEY_DOWN   = 0x0002;
    const static u16 KEY_LEFT   = 0x0004;
    const static u16 KEY_RIGHT  = 0x0008;
    const static u16 KEY_A      = 0x0010;
    const static u16 KEY_B      = 0x0020;
    const static u16 KEY_X      = 0x0040;
    const static u16 KEY_Y      = 0x0080;
    const static u16 KEY_L      = 0x0100;
    const static u16 KEY_R      = 0x0200;
    const static u16 KEY_SELECT = 0x0400;
    const static u16 KEY_START  = 0x0800;

    const static u16 KEY_CROSS_MASK = 0x000F;
    const static u16 KEY_BUTTON_MASK = 0x0FF0;

    /**
     * 读取按钮
     */
    virtual void readKey() = 0;
    /**
     * 刚按下
     */
    virtual bool isKeyPress(u16 key) = 0;
    /**
     * 刚释放
     */
    virtual bool isKeyRelease(u16 key) = 0;
    /**
     * 按住
     */
    virtual bool isKeyHold(u16 key) = 0;
    /**
     * 按下或按住
     */
    virtual bool isKeyDown(u16 key) = 0;

    /**
     * 读取鼠标或触摸屏
     */
    virtual void readTouch() = 0;
    /**
     * 是否按下屏幕（鼠标
     */
    virtual bool isTouchPress() = 0;
    /**
     * 是否松开屏幕（鼠标
     */
    virtual bool isTouchRelease() = 0;
    /**
     * 是否按住屏幕（鼠标
     */
    virtual bool isTouchHold() = 0;
    /**
     * 是否按下或按住屏幕（鼠标
     */
    virtual bool isTouchDown() = 0;

    /**
     * 获取按下的位置
     */
    virtual Point2D* getTouchPos() = 0;

};


#endif // ICONTROLLERPAD_H
